﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>使用key唯一令牌解决表单值混乱问题</title>
    <link href="../css/bootstrap.css"/>
    <link href="../css/bootstrap-theme.css"/>
</head>
<body>
<h1>使用key唯一令牌解决表单值混乱问题</h1><br/>

<div id="hdcms">
    <template v-if="regType=='mail'">
        邮箱: <input type="text" name="username" key="mail-register">
    </template>
    <template v-else>
        手机: <input type="text" name="username" key="phone-register">
    </template>
    <br>
    <input type="radio" value="mail" v-model="regType"> 邮箱注册
    <input type="radio" value="phone" v-model="regType"> 手机注册
</div>
<script src="../js/jquery-2.2.0.min.js"></script>
<script src="../js/vue-2.5.16.js"></script>
<script src="../node_modules/axios/dist/axios.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>

<script>
    var app = new Vue({
        el: '#hdcms',
        data: {
            regType: 'mail'
        }
    });
</script>

</body>
</html>